<!DOCTYPE html>
<html lang="zh_CN">
<head>
  <meta charset="UTF-8">
  <title>子账户管理</title>
  <link href="/mix/bootstrap.min.css" rel="stylesheet">
  <link href="/mix/bootstrap-theme.min.css" rel="stylesheet">
  <link href="/mix/font-awesome.min.css" rel="stylesheet">
  <link rel="stylesheet" href="/layui/css/layui.css">
  <link href="/mix/jquery-ui.min.css" rel="stylesheet">
  <link href="/mix/jquery-ui.theme.min.css" rel="stylesheet">
  <style>
    * {
      -webkit-box-sizing: initial;
      -moz-box-sizing: initial;
      box-sizing: initial;
    }

    td, th {
      vertical-align: middle !important;
    }

    .row_text {
      width: 200px;
      display: inline-block;
    }

    .small_text {
      width: 60px;
      display: inline;
    }

    .tip_text {
      color: #999;
      font-size: smaller;
    }

    #main_form th {
      width: 15%;
    }

    #top_setting_box .top_setting_item {
      margin-top: 10px;
    }

    #recharge_setting_box .recharge_setting_item {
      margin-top: 10px;
    }

    a.layui-btn:hover {
      text-decoration: none;
    }
  </style>
</head>
<body>
<div class="layui-fluid" style="margin-top: 10px;">
  <div class="layui-row">
    <div class="layui-col-md12">
      <blockquote class="layui-elem-quote">
        子账户列表
        <a href="add.html" class="layui-btn layui-btn-sm">添加</a>
      </blockquote>
      <blockquote class="layui-elem-quote">
        <span>子账户登录地址</span>
        <span style="font-weight: bold">
          
		  
		  <a href=" {$weburl}" target="_blank" style="color: #1E9FFF"> {$weburl}</a>
        </span>
      </blockquote>
      <table class="layui-table">
        <thead>
        <tr>
          <th>ID</th>
          <th>员工登录名</th>
          <th>权限</th>
          <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {loop $list as $item}
        <tr>
          <td>{$item->id}</td>
          <td>{$item->username}</td>
          <td>{$item->authority}</td>
          <td>
            <a href="add.html?id={$item->id}" class="layui-btn layui-btn-xs">编辑</a>
            <a href="javascript:void(0)" class="layui-btn layui-btn-warm layui-btn-xs btn-del" data-id="{$item->id}">删除</a>
          </td>
        </tr>
        {/loop}
        </tbody>
      </table>
      <div class="pagination pagination-sm">{P pages}</div>
    </div>
  </div>
</div>
<script src="/mix/jquery.min.js"></script>
<script src="/mix/bootstrap.min.js"></script>
<script src="/layui/layui.js"></script>
<script src="/mix/jquery-ui.min.js"></script>
<script>
    layui.use(['laydate', 'layer', 'upload', 'form'], function () {
        var laydate = layui.laydate;
        var layer = layui.layer;
        var form = layui.form;
    });

    $('.btn-del').on('click', function () {
        if (!confirm('确定删除吗？')) return false;
        var id = $(this).attr('data-id');
        $.ajax({
            url: 'list.html',
            method: 'POST',
            data: {
                opt: 'del',
                id: id
            },
            beforeSend: function () {
                layer.load();
            }, complete: function () {
                layer.closeAll('loading');
            }, success: function (resp) {
                if (resp.status == 'success') {
                    location.reload(true);
                } else {
                    alert(resp.msg);
                }
            }, error: function () {
                alert('网络故障，稍后重试');
            }
        });
    });
</script>
</body>
</html>